home *** CD-ROM | disk | FTP | other *** search
/ Amiga Desktop Video CD / Amiga DeskTop Video CD.iso / install / forceicon / source / poolvec.h < prev    next >
Text File  |  1994-06-23  |  1KB  |  50 lines

  1.  
  2. /* $Revision Header built automatically *************** (do not edit) ************
  3. **
  4. ** © Copyright by GuntherSoft
  5. **
  6. ** File             : SnakeSYS:CPrgs/ForceIcon/PoolVec.h
  7. ** Created on       : Friday, 25.03.94 01:26:49
  8. ** Created by       : Kai Iske
  9. ** Current revision : V1.0
  10. **
  11. **
  12. ** Purpose
  13. ** -------
  14. **   - Stub functions for Pools. Act like AllocVec()/FreeVec()
  15. **
  16. ** Revision V1.0
  17. ** --------------
  18. ** created on Friday, 25.03.94 01:26:49  by  Kai Iske.   LogMessage :
  19. **     --- Initial release ---
  20. **
  21. *********************************************************************************/
  22.  
  23.  
  24.  
  25. static APTR AllocVecPool(struct FIconSema *FIconSema, ULONG Size)
  26. {
  27.     ULONG    *RetVal;
  28.  
  29.     ObtainSemaphore(&FIconSema->FIconSema);
  30.  
  31.     if((RetVal = AsmAllocPooled(FIconSema->FIconPool, Size + 4, SysBase)))
  32.         *RetVal++    = Size;
  33.  
  34.     ReleaseSemaphore(&FIconSema->FIconSema);
  35.  
  36.     return((APTR)RetVal);
  37. }
  38.  
  39.  
  40. static void FreeVecPool(struct FIconSema *FIconSema, APTR Addr)
  41. {
  42.     ULONG    Size    = *((ULONG *)Addr - 1);
  43.  
  44.     ObtainSemaphore(&FIconSema->FIconSema);
  45.  
  46.     AsmFreePooled(FIconSema->FIconPool, ((ULONG *)Addr - 1), Size, SysBase);
  47.  
  48.     ReleaseSemaphore(&FIconSema->FIconSema);
  49. }
  50.